using System;
using System.Data;
using System.Collections;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for QT_IMPORTDETIAL_MENU.
    /// </summary>
    public class QT_IMPORTDETIAL_MENUList : CollectionBase
    {
		private string _ErrMsg;
        public string ErrMsg { get { return _ErrMsg; } }
    	public QT_IMPORTDETIAL_MENUList()
    	{
	    }

		public void Add(QT_IMPORTDETIAL_MENU entity)
		{
            this.List.Add(entity);
		}

		public void Add(QT_IMPORTDETIAL_MENUList list)
		{	
			foreach(QT_IMPORTDETIAL_MENU entity in list)
			{
				this.Add(entity);
			}
		}
	
		public new virtual Enumerator GetEnumerator()
		{
		    return new Enumerator(this);
		}
		public virtual QT_IMPORTDETIAL_MENU this[int index]
		{
		    get
			{
				return (QT_IMPORTDETIAL_MENU)this.List[index];
			}
			set
			{
				this.List[index] = value;
			}
		}

		#region Find Object And List Object
		//---PrimaryKey
	public virtual QT_IMPORTDETIAL_MENU Find(string ID)
	{
	    foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	    {
		if(obj.ID.ToString().ToUpper().Trim() == ID.ToString().ToUpper().Trim())
		{
		    obj.IsExisting = true;
		    return obj;
		}
	    }
	    return null;
	}

public virtual QT_IMPORTDETIAL_MENUList FindListByID(string ID)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
		    if(obj.ID.ToString().ToUpper().Trim() == ID.ToString().ToUpper().Trim())
		    {
				List.Add(obj);
		    }
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
    	{
		_ErrMsg = ex.Message;
        		return null;
    	}
}
		//---NonPrimaryKey
        public virtual QT_IMPORTDETIAL_MENU FindByIDCODE(string IDCODE)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.IDCODE.ToString().ToUpper().Trim() == IDCODE.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual QT_IMPORTDETIAL_MENU FindByPrID(string PrID)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.PrID.ToString().ToUpper().Trim() == PrID.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual QT_IMPORTDETIAL_MENU FindByNumber(double Number)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.Number.ToString().ToUpper().Trim() == Number.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual QT_IMPORTDETIAL_MENU FindByPrice(decimal Price)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.Price.ToString().ToUpper().Trim() == Price.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual QT_IMPORTDETIAL_MENU FindByUnitName(string UnitName)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.UnitName.ToString().ToUpper().Trim() == UnitName.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual QT_IMPORTDETIAL_MENU FindByDiscountMoney(decimal DiscountMoney)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.DiscountMoney.ToString().ToUpper().Trim() == DiscountMoney.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual QT_IMPORTDETIAL_MENU FindByTotalMoney(decimal TotalMoney)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.TotalMoney.ToString().ToUpper().Trim() == TotalMoney.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual QT_IMPORTDETIAL_MENU FindByDateImport(DateTime DateImport)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.DateImport.ToString().ToUpper().Trim() == DateImport.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual QT_IMPORTDETIAL_MENU FindByDateReal(DateTime DateReal)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.DateReal.ToString().ToUpper().Trim() == DateReal.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual QT_IMPORTDETIAL_MENU FindByNote(string Note)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.Note.ToString().ToUpper().Trim() == Note.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual QT_IMPORTDETIAL_MENU FindByUserName(string UserName)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.UserName.ToString().ToUpper().Trim() == UserName.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

        public virtual QT_IMPORTDETIAL_MENU FindByIDPOS(string IDPOS)
        {
	        foreach (QT_IMPORTDETIAL_MENU obj in this.List)
	        {
		        if(obj.IDPOS.ToString().ToUpper().Trim() == IDPOS.ToString().ToUpper().Trim())
		        {
		            obj.IsExisting = true;
		            return obj;
		        }
	        }
	        return null;
        }

public virtual QT_IMPORTDETIAL_MENUList FindListByIDCODE(string IDCODE)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.IDCODE.ToString().ToUpper().Trim() == IDCODE.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual QT_IMPORTDETIAL_MENUList FindListByPrID(string PrID)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.PrID.ToString().ToUpper().Trim() == PrID.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual QT_IMPORTDETIAL_MENUList FindListByNumber(double Number)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.Number.ToString().ToUpper().Trim() == Number.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual QT_IMPORTDETIAL_MENUList FindListByPrice(decimal Price)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.Price.ToString().ToUpper().Trim() == Price.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual QT_IMPORTDETIAL_MENUList FindListByUnitName(string UnitName)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.UnitName.ToString().ToUpper().Trim() == UnitName.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual QT_IMPORTDETIAL_MENUList FindListByDiscountMoney(decimal DiscountMoney)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.DiscountMoney.ToString().ToUpper().Trim() == DiscountMoney.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual QT_IMPORTDETIAL_MENUList FindListByTotalMoney(decimal TotalMoney)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.TotalMoney.ToString().ToUpper().Trim() == TotalMoney.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual QT_IMPORTDETIAL_MENUList FindListByDateImport(DateTime DateImport)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.DateImport.ToString().ToUpper().Trim() == DateImport.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual QT_IMPORTDETIAL_MENUList FindListByDateReal(DateTime DateReal)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.DateReal.ToString().ToUpper().Trim() == DateReal.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual QT_IMPORTDETIAL_MENUList FindListByNote(string Note)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.Note.ToString().ToUpper().Trim() == Note.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual QT_IMPORTDETIAL_MENUList FindListByUserName(string UserName)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.UserName.ToString().ToUpper().Trim() == UserName.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}


public virtual QT_IMPORTDETIAL_MENUList FindListByIDPOS(string IDPOS)
{
	try
	{
		QT_IMPORTDETIAL_MENUList List = new QT_IMPORTDETIAL_MENUList();
		foreach (QT_IMPORTDETIAL_MENU obj in this.List)
		{
			if(obj.IDPOS.ToString().ToUpper().Trim() == IDPOS.ToString().ToUpper().Trim())
			{
				List.Add(obj);
			}
		}
		if (List.Count > 0) return List;
        		else return null;
	}
	catch(Exception ex)
	{
		 _ErrMsg = ex.Message;
       	 	return null;
    	}
}
		#endregion
     
		#region Inner Classes
		/// <summary>
		/// Type-specific enumeration class, used by LogCollection.GetEnumerator.
		/// </summary>
		public class Enumerator : IEnumerator
		{
			private IEnumerator wrapped;

			public Enumerator(QT_IMPORTDETIAL_MENUList collection)
			{
				this.wrapped = ((CollectionBase)collection).GetEnumerator();
			}

			public QT_IMPORTDETIAL_MENU Current
			{
				get
				{
					return (QT_IMPORTDETIAL_MENU)(this.wrapped.Current);
				}
			}

			object IEnumerator.Current
			{
				get
				{
					return (QT_IMPORTDETIAL_MENU)(this.wrapped.Current);
				}
			}

			public bool MoveNext()
			{
				return this.wrapped.MoveNext();
			}

			public void Reset()
			{
				this.wrapped.Reset();
			}
      }
      #endregion  
   }
}